﻿using ComPortClass;
using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace SimStatus.Console
{
    class Program
    {
        static void Main(string[] args)
        {
            if (args[0].ToLower() == "createconn")
            {
                DialConnection dial = new DialConnection(args[1], "*99***1#");
                var result = dial.CreateConnection();
                switch (result)
                {
                    case CreateConnectionStatus.Error: System.Console.WriteLine("Error");
                        break;

                    case CreateConnectionStatus.Exsit: System.Console.WriteLine("Exsit");
                        break;

                    case CreateConnectionStatus.Success: System.Console.WriteLine("Success");
                        break;
                }
            }
            else if (args[0].ToLower() == "reg")
            {

            }
            else if (args[0].ToLower() == "GAUB")
            {
                DialConnection dial = new DialConnection(args[1], "*99***1#");
                var res = dial.GetAllUserPhoneBook();
                System.Console.WriteLine(JsonConvert.SerializeObject(res));
            }
            else
            {
                System.Console.WriteLine("Unknow");
            }
        }
    }
}
